package com.hui.exception;


/**
 * 全局错误
 * Created by LiaoYunHui on 2017/8/31.
 */
public class GlobalError {
    /**
     * 在这里定义错误消息
     */
    public static final GlobalError SERVER_EXCEPTION = make(500, "服务器内部错误，请稍后再试");
    public static final GlobalError ILLEGAL_ARGUMENT_EXCEPTION = make(403, "服务器内部错误，请稍后再试");
    public static final GlobalError HTTP_CONTENT_INVALID = make(-10003, "无法解析请求内容");

    public String msg = "";
    public int code = -1;

    GlobalError(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static GlobalError make(int code, String msg) {
        return new GlobalError(code, msg);
    }

}
